<?php
/**
 * Project: AIGC
 * Author: moufer <moufer@163.com>
 * Date: 2024/7/19 01:05
 */

namespace module\user\front\table;

use mof\front\Table;

class VipLogTable extends Table
{
    protected string $serverBaseUrl  = '/{module}/admin/{table}';
    protected array  $toolbarButtons = ['refresh', 'search'];
    protected bool $tableSelection = false;

    public function operation(): array
    {
        return [
            'show'    => false,
            'buttons' => [],
        ];
    }

    protected function columnUserId(): array
    {
        return [
            "prop"   => 'user_id',
            "label"  => '用户ID',
            "search" => true,
        ];
    }

    protected function columnNickname(): array
    {
        return [
            "prop"  => 'user.nickname',
            "label" => '用户昵称',
            "width" => '*'
        ];
    }

    public function columnBeginDate(): array
    {
        return [
            "prop"  => 'begin_date',
            "label" => '开始时间',
            "width" => '*'
        ];
    }

    public function columnEndDate(): array
    {
        return [
            "prop"  => 'end_date',
            "label" => '到期时间',
            "width" => '*'
        ];
    }

    public function columnCreateAt(): array
    {
        return [
            "prop"   => 'create_at',
            "label"  => '记录时间',
            "type"   => 'datetime',
            "width"  => '*',
            "search" => [
                "type" => 'daterange',
            ]
        ];
    }

}